<?php
if (!defined('ROOT')) {
   die("Impossible de voir ce fichier directement.");
}
include_once (ROOT.'/inc/classes/Model.php');

class Video extends Model
{
    var $table="videos";
    var $index = "id";
    
    var $id;
    var $name;
    var $description;
    var $url;
    var $category_id;
    var $tag;
    var $user_id;
    var $validated = false;
    var $privated = true;
    var $created;
    var $updated;
    
    
    function getFields()
    {
        $this->fields['id'] = $this->id;
        $this->fields['name'] = $this->name;
        $this->fields['description'] = $this->description;
        $this->fields['url'] = $this->url;
        $this->fields['category_id'] = $this->category_id;
        $this->fields['tag'] = $this->tag;
        $this->fields['user_id'] = $this->user_id;
        $this->fields['validated'] = $this->validated;
        $this->fields['private'] = $this->privated;
        $this->fields['created'] = $this->created;
        $this->fields['updated'] = $this->updated;
    }
    
    function setFields()
    {
        $this->id = $this->fields['id'];
        $this->name = $this->fields['name'];
        $this->description = $this->fields['description'];
        $this->url = $this->fields['url'];
        $this->category_id = $this->fields['category_id'];
        $this->tag = $this->fields['tag'];
        $this->user_id = $this->fields['user_id'];
        $this->validated = $this->fields['validated'];
        $this->privated = $this->fields['private'];
        $this->created = $this->fields['created'];
        $this->updated = $this->fields['updated'];
    }
}
